<script type="text/x-handlebars-template" id="goodsPakages">

  <header class="wst-nav">
    <div class="am-g">
      <div class="am-u-sm-2">
        <a href="#" class="wst-header-left"><i class="am-icon-angle-left am-icon-sm"></i></a>
      </div>
      <div class="am-u-sm-8 wst-nav-center">
        <span class="wst-header-center">优惠套餐</span>
      </div>
      <div class="am-u-sm-2">&nbsp;</div>
    </div>
  </header>
  
  <div class="gp-pakage-container">

    <div class="am-panel-group" id="pakageAccordion">

      
      <div class="am-panel am-panel-default" style="border: none;">

        {{#each packageList}}
          <div class="am-g am-panel-hd gp-pakage-top">
            <div class="am-u-sm-10 gp-pakage-gpname" data-am-collapse="{parent: '#pakageAccordion', target: '#package-{{packageId}}'}">
              <span class="gp-name">{{packageName}}</span>
              <span class="gp-total">￥<span id="packagePrice-{{packageId}}">{{packagePrice}}</span></span> 
              <span class="gp-discount">立省￥{{diffPrice}}</span>
            </div>
            <div class="am-u-sm-2 gp-pakage-top-right">
              <span class="gp-pakage-status"><i class="am-icon-angle-right am-icon-sm"></i></span>
            </div>
          </div>
          <div id="package-{{packageId}}" class="am-panel-collapse am-collapse {{#compare @index 0}}am-in{{/compare}}">
            <div class="am-panel-bd" style="border: none;padding: .5rem;">
              <div id="" class="gp-pakage">

              {{#each goods}}
                <div class="am-g gp-pakage-middle">
                  <div class="am-u-sm-4">
                    <img class="gp-pakage-img" src="{{../defaultImg}}" data-echo="{{../rooturl}}/{{goodsThums}}">
                  </div>
                  <div class="am-u-sm-8">
                    <input type="hidden" class="goodsInfo" value="{{goodsId}}" goodsId="{{goodsId}}" goodsAttrId="{{goodsAttrId}}" goodsPrice="{{packageGoodsPrice}}" autocomplete="off">
                    <span class="gp-pakage-name">{{goodsName}}</span><br>
                    <span class="gp-pakage-price">
                      ￥<span id="goods-{{../packageId}}-{{goodsId}}">{{packageGoodsPrice}}</span>
                    </span>
                  </div>
                  <div class="am-u-sm-12 gp-priceattr-container">
                    {{priceAttrName}} &nbsp;
                    {{#each priceAttrs}}
                      <button type="button" class="am-btn am-btn-default am-btn-xs am-radius priceattr {{#compare isRecomm 1}}active{{/compare}}" onclick="javascript:selectGoodsAttr(this, {{id}}, {{../goodsId}}, {{../../packageId}}, {{../diffPrice}});">{{attrVal}}</button> 
                    {{/each}}
                  </div>
                </div>
              {{/each}}

              <div class="am-g gp-pakage-bottom">
                <div class="am-u-sm-12 gp-pakage-add" onclick="javascript:addGoodsPackageToCart({{packageId}});">加入购物车</div>
              </div>
            </div>
          </div>
        </div>
      {{/each}}
      

    </div>

  </div>
</script>